package com.xes.rabbitmq.producte.service.impl;

import com.xes.rabbitmq.core.domain.tables.pojos.TbStudent;
import com.xes.rabbitmq.core.service.SenderStudentService;
import com.xes.rabbitmq.core.service.StudentService;
import com.xes.rabbitmq.producte.service.StudentSenderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentSenderServiceImpl implements StudentSenderService {

    @Autowired
    private StudentService studentService;

    @Autowired
    private SenderStudentService senderStudentService;

    @Override
    public void createStudent(TbStudent student, String messageId) {

        studentService.createStudent(student, messageId);

        senderStudentService.send(student, messageId);
    }
}
